﻿
using Microsoft.EntityFrameworkCore;
namespace BDQN.Entities
{
    public class BlogSysDbContext : DbContext
    {
        public BlogSysDbContext(DbContextOptions<BlogSysDbContext> opt)
            :base(opt)
        {
            
        }

        protected override void OnModelCreating(ModelBuilder modelBuilder)
        {
            base.OnModelCreating(modelBuilder);
            // 我们在这个里面可以给某些表带有一个初始数据
            modelBuilder.Entity<Roles>().HasData(
                new Roles { Id = 1, Title = "普通管理员" },
                new Roles { Id = 2,Title = "超级管理员"}
            );
        }


        public DbSet<About> About { get; set; }
        public DbSet<Achievement> Achievement { get; set; }
        public DbSet<Admins> Admins { get; set; }
        public DbSet<AdminsPermissions> AdminsPermissions { get; set; }
        public DbSet<Banner> Banner { get; set; }
        public DbSet<Blog> Blog { get; set; }
        public DbSet<BlogTags> BlogTags { get; set; }
        public DbSet<Copyright> Copyright { get; set; }
        public DbSet<Roles> Roles { get; set; }
        public DbSet<Seos> Seos { get; set; }
        public DbSet<Skills> Skills { get; set; }
        public DbSet<SystemMenus> SystemMenus { get; set; }
        public DbSet<Tags> Tags { get; set; }
        public DbSet<WebMenus> WebMenus { get; set; }
        public DbSet<Works> Works { get; set; }




    }
}
